package org.example;

class NetworkChallenge implements CodeChallenge {
    private String description;

    public NetworkChallenge(String desc) {
        this.description = desc;
    }

    @Override
    public String getDescription() {
        return "【网络挑战】\n" + description + "\n实现要求:\n" +
                "1. 建立Socket连接\n" +
                "2. 使用SSL加密\n" +
                "3. 设置超时时间";
    }

    @Override
    public String getHint() {
        return "使用SSLSocketFactory创建安全连接";
    }

    @Override
    public boolean validateSolution(String code) {
        return code.contains("SSLSocketFactory") &&
                code.contains("createSocket") &&
                code.contains("setSoTimeout");
    }
}
